<?php
include("../CrawlerURL.php");
class CrawerURLAndroid implements CrawlerURL{
	public function parseURLS($url,$reg){
		$isCollect = true;

		$fp = @fopen($url,"r") or $isCollect = false;

		if(isCollect){
			
		 
			$ch = curl_init();
			curl_setopt($ch, CURLOPT_URL,$url);
			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
			curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
			$result = curl_exec($ch);
			curl_close($ch);
 
			//$result = curl_exec($ch);
			
		//	$fcontent = file_get_contents($url,"r");
		//	$games = iconv("gbk", "utf-8//IGNORE", $fcontent);
		//	eregi("<div class=\"ClassGameList\">\r\n<div id=\"tab1\">\r\n<ul>(.*)</ul>\r\n<div id=\"PageList01\">", $games,$ab);
		//	preg_match_all("/<a href=\"(.*?)\"><img/",$ab[0],$abc);
		    preg_match_all("/$reg/",$result,$urls);
			//$urls = $abc[1];
			
			return $urls[1];
		}
	}
}